home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / E-G / educationstacks.sea / Circuits / card_3413.txt < prev    next >
Text File  |  1989-02-26  |  7KB  |  289 lines

  1. -- card: 3413 from stack: in
  2. -- bmap block id: 2123
  3. -- flags: 4000
  4. -- background id: 2693
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on closeField
  8.   set hilite of card button "S1 closed" to false
  9.   set hilite of card button "S1 middle" to true
  10.   set hilite of card button "S1 middle" to false
  11.   set hilite of card button "S1 open" to true
  12.   send zeroall
  13. end closeField
  14.  
  15. on calculate
  16.  
  17.   get char 1 of card field "EMF"
  18.   if it="+" then
  19.     delete char 1 of card field "EMF"
  20.   end if
  21.   put card field "EMF" into E
  22.  
  23.   get char 1 of card field "R1"
  24.   if it="+" then
  25.     delete char 1 of card field "R1"
  26.   end if
  27.   put card field "R1" into R1
  28.   put abs(R1) into card field "R1"
  29.   put abs(R1) into R1
  30.  
  31.   if E=0 then
  32.     send zeroall
  33.     exit calculate
  34.   else
  35.  
  36.     if R1=0 then
  37.       put "zap" into card field "A1"
  38.       put 0 into card field "V1"
  39.       exit calculate
  40.     end if
  41.  
  42.     put E/R1 into I1
  43.     put E/1 into V1
  44.  
  45.   end if
  46.  
  47.   set numberFormat to "0.000"
  48.   put I1 into card field "A1"
  49.   put V1 into card field "V1"
  50.  
  51. end calculate
  52.  
  53. on zeroall
  54.   put 0 into card field "A1"
  55.   put 0 into card field "V1"
  56. end zeroall
  57.  
  58.  
  59.  
  60.  
  61. -- part 1 (field)
  62. -- low flags: 01
  63. -- high flags: 0002
  64. -- rect: left=198 top=251 right=266 bottom=258
  65. -- title width / last selected line: 0
  66. -- icon id / first selected line: 0 / 0
  67. -- text alignment: 65535
  68. -- font id: 3
  69. -- text size: 10
  70. -- style flags: 256
  71. -- line height: 13
  72. -- part name: V1
  73.  
  74.  
  75. -- part 2 (field)
  76. -- low flags: 01
  77. -- high flags: 0002
  78. -- rect: left=89 top=155 right=170 bottom=145
  79. -- title width / last selected line: 0
  80. -- icon id / first selected line: 0 / 0
  81. -- text alignment: 65535
  82. -- font id: 3
  83. -- text size: 10
  84. -- style flags: 256
  85. -- line height: 13
  86. -- part name: A1
  87.  
  88.  
  89. -- part 4 (field)
  90. -- low flags: 00
  91. -- high flags: 0000
  92. -- rect: left=191 top=34 right=61 bottom=253
  93. -- title width / last selected line: 0
  94. -- icon id / first selected line: 0 / 0
  95. -- text alignment: 65535
  96. -- font id: 3
  97. -- text size: 18
  98. -- style flags: 256
  99. -- line height: 24
  100. -- part name: EMF
  101.  
  102.  
  103. -- part 5 (field)
  104. -- low flags: 00
  105. -- high flags: 0000
  106. -- rect: left=199 top=146 right=173 bottom=261
  107. -- title width / last selected line: 0
  108. -- icon id / first selected line: 0 / 0
  109. -- text alignment: 65535
  110. -- font id: 3
  111. -- text size: 18
  112. -- style flags: 256
  113. -- line height: 24
  114. -- part name: R1
  115.  
  116.  
  117. -- part 6 (button)
  118. -- low flags: 00
  119. -- high flags: 4001
  120. -- rect: left=327 top=128 right=148 bottom=339
  121. -- title width / last selected line: 0
  122. -- icon id / first selected line: 0 / 0
  123. -- text alignment: 1
  124. -- font id: 0
  125. -- text size: 12
  126. -- style flags: 0
  127. -- line height: 16
  128. -- part name: S1 closed
  129. ----- HyperTalk script -----
  130. on mouseUp
  131.   get hilite of card button "S1 closed"
  132.   if it=true then
  133.     set hilite of card button "S1 closed" to false
  134.     set hilite of card button "S1 middle" to true
  135.     set hilite of card button "S1 middle" to false
  136.     set hilite of card button "S1 open" to true
  137.     send zeroall
  138.   else
  139.     set hilite of card button "S1 open" to false
  140.     set hilite of card button "S1 middle" to true
  141.     set hilite of card button "S1 middle" to false
  142.     set hilite of card button "S1 closed" to true
  143.     send calculate
  144.   end if
  145. end mouseUp
  146.  
  147.  
  148.  
  149. -- part 8 (button)
  150. -- low flags: 00
  151. -- high flags: 0001
  152. -- rect: left=315 top=128 right=148 bottom=327
  153. -- title width / last selected line: 0
  154. -- icon id / first selected line: 0 / 0
  155. -- text alignment: 1
  156. -- font id: 0
  157. -- text size: 12
  158. -- style flags: 0
  159. -- line height: 16
  160. -- part name: S1 middle
  161. ----- HyperTalk script -----
  162. on mouseUp
  163.   get hilite of card button "S1 closed"
  164.   if it=true then
  165.     set hilite of card button "S1 closed" to false
  166.     set hilite of card button "S1 middle" to true
  167.     set hilite of card button "S1 middle" to false
  168.     set hilite of card button "S1 open" to true
  169.     send zeroall
  170.   else
  171.     set hilite of card button "S1 open" to false
  172.     set hilite of card button "S1 middle" to true
  173.     set hilite of card button "S1 middle" to false
  174.     set hilite of card button "S1 closed" to true
  175.     send calculate
  176.   end if
  177. end mouseUp
  178.  
  179.  
  180. -- part 9 (button)
  181. -- low flags: 00
  182. -- high flags: 0001
  183. -- rect: left=304 top=128 right=148 bottom=316
  184. -- title width / last selected line: 0
  185. -- icon id / first selected line: 0 / 0
  186. -- text alignment: 1
  187. -- font id: 0
  188. -- text size: 12
  189. -- style flags: 0
  190. -- line height: 16
  191. -- part name: S1 open
  192. ----- HyperTalk script -----
  193. on mouseUp
  194.   get hilite of card button "S1 closed"
  195.   if it=true then
  196.     set hilite of card button "S1 closed" to false
  197.     set hilite of card button "S1 middle" to true
  198.     set hilite of card button "S1 middle" to false
  199.     set hilite of card button "S1 open" to true
  200.     send zeroall
  201.   else
  202.     set hilite of card button "S1 open" to false
  203.     set hilite of card button "S1 middle" to true
  204.     set hilite of card button "S1 middle" to false
  205.     set hilite of card button "S1 closed" to true
  206.     send calculate
  207.   end if
  208. end mouseUp
  209.  
  210.  
  211.  
  212. -- part 10 (button)
  213. -- low flags: 00
  214. -- high flags: 0000
  215. -- rect: left=339 top=128 right=147 bottom=400
  216. -- title width / last selected line: 0
  217. -- icon id / first selected line: 0 / 0
  218. -- text alignment: 1
  219. -- font id: 0
  220. -- text size: 12
  221. -- style flags: 0
  222. -- line height: 16
  223. -- part name: Switch
  224. ----- HyperTalk script -----
  225. on mouseUp
  226.   get hilite of card button "S1 closed"
  227.   if it=true then
  228.     set hilite of card button "S1 closed" to false
  229.     set hilite of card button "S1 middle" to true
  230.     set hilite of card button "S1 middle" to false
  231.     set hilite of card button "S1 open" to true
  232.     send zeroall
  233.   else
  234.     set hilite of card button "S1 open" to false
  235.     set hilite of card button "S1 middle" to true
  236.     set hilite of card button "S1 middle" to false
  237.     set hilite of card button "S1 closed" to true
  238.     send calculate
  239.   end if
  240. end mouseUp
  241.  
  242.  
  243. -- part 11 (button)
  244. -- low flags: 00
  245. -- high flags: 0001
  246. -- rect: left=201 top=297 right=333 bottom=255
  247. -- title width / last selected line: 0
  248. -- icon id / first selected line: 0 / 0
  249. -- text alignment: 1
  250. -- font id: 0
  251. -- text size: 12
  252. -- style flags: 0
  253. -- line height: 16
  254. -- part name: 
  255.  
  256.  
  257. -- part 12 (button)
  258. -- low flags: 00
  259. -- high flags: 0001
  260. -- rect: left=147 top=297 right=333 bottom=201
  261. -- title width / last selected line: 0
  262. -- icon id / first selected line: 0 / 0
  263. -- text alignment: 1
  264. -- font id: 0
  265. -- text size: 12
  266. -- style flags: 0
  267. -- line height: 16
  268. -- part name: 
  269.  
  270.  
  271. -- part contents for background part 8
  272. ----- text -----
  273. C1. Ohm's Law
  274.  
  275. -- part contents for card part 4
  276. ----- text -----
  277. 100
  278.  
  279. -- part contents for card part 5
  280. ----- text -----
  281. 25
  282.  
  283. -- part contents for card part 2
  284. ----- text -----
  285. 4.000
  286.  
  287. -- part contents for card part 1
  288. ----- text -----
  289. 100.000